#brute force with factorization

import math

def prime(n):
	factors = [i for i in range(2, int(math.sqrt(n)+1)) if n%i==0]
	return len(factors)==0

def prime_gen():
	i = 3 
	n = 2 
	while 1:
		if (prime(i)): 
			yield i,n
			n += 1
		i += 2
		

for i in prime_gen():
	print(i)
	if i[1]==6: assert(i[0]==13)
	if(i[1]==10001): break
